package redis

import (
	"github.com/go-redis/redis"
)

func NewRedis(addr string, pwd string, db int) (*redis.Client, error) {
	redisdb := redis.NewClient(&redis.Options{
		Addr:     addr, // use default Addr
		Password: pwd,  // no password set
		DB:       db,   // use default DB
	})
	_, err := redisdb.Ping().Result()
	return redisdb, err
}
